package com.wwj.controller.user;

import com.wwj.common.result.Result;
import com.wwj.pojo.entity.Check;
import com.wwj.service.CheckService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController("userCheckController")
@RequestMapping("/user/check")
@Slf4j
@Api(tags="体检项目相关接口")
public class CheckController {

    @Resource
    private CheckService checkService;

    @GetMapping("/list")
    @ApiOperation("查询启用检查项")
    @Cacheable(cacheNames = "CheckCache",key = "1")
    public Result<List<Check>> list(){
        List<Check> list = checkService.list();
        return Result.success(list);
    }
}
